<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/page/common/public.jspf"%>
<%@ page import="com.hengpeng.itfints.tools.PageUtil"%>
<%
	PageUtil pageUtil = (PageUtil) request.getAttribute("PageUtil");
%>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="${skin}/v1.min.css?v=${v}" />
<link rel="stylesheet" type="text/css" href="${skin}/index.css?v=${v}" />
<link href="${skin}/account_personalset.css?v=${v}" type="text/css"	rel="stylesheet">
<link rel="stylesheet" type="text/css" href="${skin}/user_web2.css?v=${v}" />
<link rel="stylesheet" type="text/css" href="${skin }/paginate.v1.css">
<script type="text/javascript"
	src="${path }/js/jquery1.10.2.min.js?v=${v}"></script>
<script type="text/javascript" src="${path }/js/v1.min.js?v=${v}"></script>
<title>${configUtil.sitename}-回款计划</title>
<style>
.yqjilu thead tr {
	border-bottom: 1px solid #e5e5e5;
}
</style>
</head>

<body>
	<!-- head -->
	<c:import url="../../include/top.jsp"></c:import>

	<div class="wrap">
		<div class="blank"></div>
		<div class="user_nav f_l mr5">
			<c:import url="../left.jsp"><c:param name="type" value="receive"></c:param></c:import>
		</div>
		<div class="user_right f_l">
			<div class="user_right">
						<div class="user_right_box mb15 user_right_box_v2">
							<div class="user_title">
								<h1>
									<i class="ico_xiangmu"></i>回款计划
								</h1>
							</div>
							<input type="hidden" name="investInfoStatus"
								id="investInfoStatus" value="${investInfoStatus}" />
								<div class="screening clearfix">
									<div class="select_box" data-name="status">
										<div class="j_select"></div>
										<ul class="select_ul none j_selectContent">
											<li data-value="WAITREC">待回款</li>
											<li data-value="RECEIVED">已回款</li>
										</ul>
									</div>
									<input type="hidden" name="type" value="" />
									<div class="sel_time">
										<span>时间</span> <input type="text" class="time_box"
											id="dateInput1" name="date_start" value="${startTime }"><span
											class="pl10">-</span><input type="text" class="time_box"
											id="dateInput2" name="date_end" value="${endTime }">
									</div>
									<input type="button" value="筛选" class="button_shaixian fr">
								</div>
								<c:if test="${fn:length(myReceivePlanList) > 0}">
							<table class="yqjilu" height="226">
								<colgroup>
									<col width="150">
									<col width="150">
									<col width="100">
									<col width="120">
									<col width="50">
									<col width="70">
									<col width="70">
								</colgroup>
								<thead>
									<tr>
										<th>标的名称</th>
										<td>回款日期</td>
										<td>月收本金</td>
										<td>月收利息</td>
										<td nowrap="nowrap">当前期数</td>
										<td>总期数</td>
										<td>状态</td>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${myReceivePlanList}" var="plan"
										begin="<%=pageUtil.getFromIndex()%>"
										end="<%=pageUtil.getToIndex() %>" varStatus="vstatus">
										<c:choose>
									<c:when test="${vstatus.index%2 == 0}">
										<tr class="tr_bg">
											<th>${plan.borrowName }</th>
											<td><c:choose>
													<c:when test="${empty plan.arrivalTime}">
														<fmt:formatDate value="${plan.receiveTime}" type="both"
															pattern="yyyy/MM/dd" />
													</c:when>
													<c:otherwise>
														<fmt:formatDate value="${plan.arrivalTime}" type="both"
															pattern="yyyy/MM/dd" />
													</c:otherwise>
												</c:choose></td>
											<td><fmt:formatNumber value="${plan.recBaseMoney/100}"
													type="currency" pattern="￥0.00" /></td>
											<td><fmt:formatNumber
													value="${(plan.recInterestMoney + plan.recAddMoney)/100}"
													type="currency" pattern="￥0.00" /></td>
											<td>${plan.curRecNum}</td>
											<td>${plan.totalRecNum}</td>
											<td>${plan.status.text}</td>
										</tr>
										</c:when>
										<c:otherwise>
										<tr>
											<th>${plan.borrowName }</th>
											<td><c:choose>
													<c:when test="${empty plan.arrivalTime}">
														<fmt:formatDate value="${plan.receiveTime}" type="both"
															pattern="yyyy/MM/dd" />
													</c:when>
													<c:otherwise>
														<fmt:formatDate value="${plan.arrivalTime}" type="both"
															pattern="yyyy/MM/dd" />
													</c:otherwise>
												</c:choose></td>
											<td><fmt:formatNumber value="${plan.recBaseMoney/100}"
													type="currency" pattern="￥0.00" /></td>
											<td><fmt:formatNumber
													value="${(plan.recInterestMoney + plan.recAddMoney)/100}"
													type="currency" pattern="￥0.00" /></td>
											<td>${plan.curRecNum}</td>
											<td>${plan.totalRecNum}</td>
											<td>${plan.status.text}</td>
										</tr>
										</c:otherwise>
										</c:choose>
									</c:forEach>
								</tbody>
							</table>
							</c:if>
						</div>
					<c:if test="${fn:length(myReceivePlanList) <= 0}">
						<section>
							<div class="project clearfix u_zijin">
								<div class="pro_detailed clearfix">
									<div class="empty-box">没有记录</div>
								</div>
							</div>
						</section>
						</c:if>
			</div>
			 <div class="user_tip charge_tip" style="border: 1px solid #e3e3e3;">
                <p>1、回款金额会在回款当日24点前到达您的平台账户，请您耐心等待。</p>
                <p>2、如果回款金额没有及时到账，可通过拨打<span class="color-yellow1"> <m:xml key="page.service.tel"></m:xml> </span> （工作时间<m:xml key="page.service.time"></m:xml>）寻求帮助。</p>
            </div>
			<c:import url="../../include/false_paging.jsp"></c:import>
		</div>

		<div class="blank"></div>
	</div>

	<c:import url="../../include/foot.jsp"></c:import>

	<script type="text/javascript">
	$(".button_shaixian").click(function(){
		var receiveStatus = $('#status').val();
		var startTime = $('#dateInput1').val();
		var endTime = $('#dateInput2').val();
		window.location.href = "<%=request.getContextPath()%>/repayment/myReceivePlanList.htm?curPage=1&receiveStatus="+receiveStatus+"&startTime="+startTime+"&endTime="+endTime;
	});
	//分页
	function go (page) {
		var startTime = $('#dateInput1').val();
		var endTime = $('#dateInput2').val();
		window.location.href = "<%=request.getContextPath()%>/repayment/myReceivePlanList.htm?curPage="+page+"&receiveStatus=${receiveStatus}&startTime="+startTime+"&endTime="+endTime;
	}
	$(function(){
		var vstatus = '${receiveStatus}';
		if(vstatus == 'WAITREC'){
			$('.j_select').text('待回款');
			$('#status').attr("value","WAITREC")
		}else if(vstatus == 'RECEIVED'){
			$('.j_select').text('已回款');
			$('#status').attr("value","RECEIVED")
		}
	});
</script>
</body>
</html>